
import LoginAndRegister from '../views/LoginAndRegister.vue'; 
import Layout from '../views/Layout.vue'; 
import {createRouter,createWebHistory} from 'vue-router'
import PurchaseManagement from '../views/PurchaseManagement.vue'
import SalesManagement from '../views/SalesManagement.vue'
import InventoryManagement from '../views/InventoryManagement.vue'
import AttendanceManagement from '../views/AttendanceManagement.vue'
import ProcessManagement from '../views/ProcessManagement.vue'
import UserManagement from '../views/UserManagement.vue'


const routes = [
  {
    path: '/',
    name: 'Login',
    component: LoginAndRegister
  },
  {
    path:'/layout',
    name: 'Layout',
    component: Layout,
    redirect: '/layout/purchase',
    children: [
        {
          path: 'purchase',
          name: 'PurchaseManagement',
          component: PurchaseManagement
        },
        {
          path: 'sales',
          name: 'SalesManagement',
          component: SalesManagement
        },
        {
          path: 'inventory',
          name: 'InventoryManagement',
          component: InventoryManagement
        },
        {
          path: 'attendance',
          name: 'AttendanceManagement',
          component: AttendanceManagement
        },
        {
          path: 'process',
          name: 'ProcessManagement',
          component: ProcessManagement
        },
        {
          path: 'user',
          name: 'UserManagement',
          component: UserManagement
        }
      ]
  }

];

const router = createRouter({
    routes,
    history:createWebHistory()
})

export default router;